package Code.WhileDemo;

//珠穆朗玛峰
public class Test2 {
    public static void main(String[] args) {
        //珠穆朗玛风的高度
        double mountain = 8844.43;
        //纸张的厚度
        double paper = 0.0001;
        //次数
        int count = 0;
        while (paper < mountain) {
            paper *= 2;
            count++;
        }
        System.out.println(count);

        paper = 0.0001;
        count = 0;
        for (double i = paper; i < mountain; i *= 2) {
            count++;
        }
        System.out.println(count);
    }
}
